import React from "react";
import Sidebar from "./components/sidebar/Sidebar";
import Topbar from "./components/topbar/Topbar";
import Home from './pages/home/Home'
import UserList from "./pages/userList/UserList";
import User from './pages/user/User'
import NewUser from "./pages/newUser/newUser";
import ProductList from "./pages/productList/productList"
import Product from "./pages/product/Product"
import NewProduct from "./pages/newProduct/NewProduct"
import './app.css'
// 路由
import{
  BrowserRouter as Router,
  Routes,
  Route
} from "react-router-dom"

function App() {
  return (
    <Router>
       <Topbar />
      <div className="container">
        <Sidebar />
        <Routes>
          <Route exact  path="/" element={<Home />} />
          <Route path="/users" element={<UserList />} />
          <Route path="/user/:userId" element={<User />} />
          <Route path="/newUser" element={<NewUser />}/>
          <Route path="/products" element={<ProductList />}/>
          <Route path="/products/:productId" element={<Product />}/>
          <Route path="/newproduct" element={<NewProduct />}/>
            
        </Routes>
      </div>
    </Router>
  );
}

export default App;
